package com.evil.application.pojo.dto.order;

import com.evil.common.application.dto.judge.JudgeOr;
import com.evil.common.application.dto.order.OrderQueryReqDTO;
import com.evil.common.core.enums.SwitchEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;

/**
 * 订单列表 请求实体
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class OrderPageReqDTO extends OrderBaseReqDTO {

    /**
     * 搜索引擎
     */
    private String keyword;

    /**
     * 是否模糊查询 (0-否，1-是)
     */
    private Integer fuzzyQuery;

    /**
     * 筛选参数
     */
    @Valid
    private List<OrderQueryReqDTO> queries;

    /**
     * 筛选条件
     */
    @Valid
    private List<JudgeOr> judgeOrs;

    /**
     * 控件列表
     */
    private List<Long> controlIds;

    /**
     * 强制使用value值匹配
     */
    private Boolean forceUseValue;

    /**
     * 转换数字控件格式
     */
    private Boolean transNumber;

    public OrderPageReqDTO() {
        this.queries = new ArrayList<>();
        this.judgeOrs = new ArrayList<>();
        this.controlIds = new ArrayList<>();
        this.fuzzyQuery = SwitchEnum.YES.getId();
        this.forceUseValue = false;
        this.transNumber = false;
    }
}
